package org.shoy.core.model;

import javax.persistence.*;

/**
 * Question
 * Created by shoy on 2016/4/2.
 */
@Entity
@Table(name = "\"tq_question\"")
public class TqQuestionEntity {
    private String id;
    private String body;

    @Id
    @Column(name = "\"id\"", nullable = false, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "\"body\"", nullable = false, length = 2048)
    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TqQuestionEntity that = (TqQuestionEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (body != null ? !body.equals(that.body) : that.body != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (body != null ? body.hashCode() : 0);
        return result;
    }
}
